(function($){ //create closure so we can safely use $ as alias for jQuery
	$(document).ready(function(){
		$('#ul-top-menu').supersubs({
			minWidth:	12,	 // minimum width of submenus in em units
			maxWidth:	27,	 // maximum width of submenus in em units
			extraWidth:	1	 // extra width can ensure lines don't sometimes turn over
							 // due to slight rounding differences and font-family
		}).superfish();		 // call supersubs first, then superfish, so that subs are
							 // not display:none when measuring. Call before initialising
							 // containing tabs for same reason.

		$('#ul-menu-primary').supersubs({
			minWidth:	12,	 // minimum width of submenus in em units
			maxWidth:	27,	 // maximum width of submenus in em units
			extraWidth:	1	 // extra width can ensure lines don't sometimes turn over
							 // due to slight rounding differences and font-family
		}).superfish();		 // call supersubs first, then superfish, so that subs are
							 // not display:none when measuring. Call before initialising
							 // containing tabs for same reason.

		$('#top-menu').tinymenu();

		$('#menu-primary').tinymenu();

		$('#camera_slider').camera({
			loader: 'none',
			playPause: false
		});

		$('#widget-tabs a').click(function (e) {
			e.preventDefault()
			$(this).tab('show')
		});

		$('#content-tabs a').click(function (e) {
			e.preventDefault()
			$(this).tab('show')
		});

		$('.carousel').carousel();

		$('.m-ttip').tooltip()
	});

	function updateIsotope() {
		var current_width = $(window).width();
		if(current_width > 768 && current_width < 992){
			$('#box-widget').isotope({
				itemSelector : '.widget'
			});

			$('#box-widget-footer').isotope({
				itemSelector : '.footer-widget'
			});
		} else if($("#box-widget").hasClass('isotope') || $("#box-widget-footer").hasClass('isotope')) {
			$('#box-widget').isotope('destroy');
			$('#box-widget-footer').isotope('destroy');
		}
	};
	$(document).ready(updateIsotope);
	$(window).resize(updateIsotope); 

	//if ($(".div-class").isotope('already-initialized')) {
    	// some other code
	//}

	$("#get-password").click(function(event){
		event.preventDefault();
		$("#form-lost-pass").slideToggle();
	});

})(jQuery);

function initialize() {
    var myLatlng = new google.maps.LatLng(44.4325, 26.1039);
    var mapOptions = {
    	zoom: 12,
        scrollwheel: false,
        center: myLatlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById('mapCanvas'), mapOptions);
    
	var marker = new google.maps.Marker({
		position: myLatlng,
		map: map,
		animation: google.maps.Animation.DROP,
		title: 'Hello World!'
	});
      
    var contentString = '<div class="info-window-content"><h2>2014</h2>'+
                        '<h3>Designing forward</h3>'+
                        '<p>Some more details for directions or company informations...</p></div>';
                          
    var infowindow = new google.maps.InfoWindow({
        content: contentString
    });
      
    google.maps.event.addListener(marker, 'click', function() {
        infowindow.open(map,marker);
    });
}
google.maps.event.addDomListener(window, 'load', initialize);